\(\int \sqrt {a-a \sec ^2(c+d x)} \, dx\) [223]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 17, antiderivative size = 33 \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=-\frac {\cot (c+d x) \log (\cos (c+d x)) \sqrt {-a \tan ^2(c+d x)}}{d} \]

[Out]

-cot(d*x+c)*ln(cos(d*x+c))*(-a*tan(d*x+c)^2)^(1/2)/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {4206, 3739, 3556} \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=-\frac {\cot (c+d x) \sqrt {-a \tan ^2(c+d x)} \log (\cos (c+d x))}{d} \]

[In]

Int[Sqrt[a - a*Sec[c + d*x]^2],x]

[Out]

-((Cot[c + d*x]*Log[Cos[c + d*x]]*Sqrt[-(a*Tan[c + d*x]^2)])/d)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3739

Int[(u_.)*((b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Tan[e + f*x]^n)^FracPart[p]/(Tan[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Tan[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rule 4206

Int[(u_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(b*tan[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {-a \tan ^2(c+d x)} \, dx \\ & = \left (\cot (c+d x) \sqrt {-a \tan ^2(c+d x)}\right ) \int \tan (c+d x) \, dx \\ & = -\frac {\cot (c+d x) \log (\cos (c+d x)) \sqrt {-a \tan ^2(c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00 \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=-\frac {\cot (c+d x) \log (\cos (c+d x)) \sqrt {-a \tan ^2(c+d x)}}{d} \]

[In]

Integrate[Sqrt[a - a*Sec[c + d*x]^2],x]

[Out]

-((Cot[c + d*x]*Log[Cos[c + d*x]]*Sqrt[-(a*Tan[c + d*x]^2)])/d)

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.15

method result size
default \(\frac {\sqrt {-a \tan \left (d x +c \right )^{2}}\, \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d \tan \left (d x +c \right )}\) \(38\)
risch \(\frac {\sqrt {\frac {a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}}\, \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) x}{{\mathrm e}^{2 i \left (d x +c \right )}-1}-\frac {2 \sqrt {\frac {a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}}\, \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left (d x +c \right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) d}-\frac {i \sqrt {\frac {a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}}\, \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) d}\) \(194\)

[In]

int((a-a*sec(d*x+c)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2/d*(-a*tan(d*x+c)^2)^(1/2)/tan(d*x+c)*ln(1+tan(d*x+c)^2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.61 \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=-\frac {\sqrt {\frac {a \cos \left (d x + c\right )^{2} - a}{\cos \left (d x + c\right )^{2}}} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right )}{d \sin \left (d x + c\right )} \]

[In]

integrate((a-a*sec(d*x+c)^2)^(1/2),x, algorithm="fricas")

[Out]

-sqrt((a*cos(d*x + c)^2 - a)/cos(d*x + c)^2)*cos(d*x + c)*log(-cos(d*x + c))/(d*sin(d*x + c))

Sympy [F]

\[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=\int \sqrt {- a \sec ^{2}{\left (c + d x \right )} + a}\, dx \]

[In]

integrate((a-a*sec(d*x+c)**2)**(1/2),x)

[Out]

Integral(sqrt(-a*sec(c + d*x)**2 + a), x)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.64 \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=\frac {\sqrt {-a} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]

[In]

integrate((a-a*sec(d*x+c)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(-a)*log(tan(d*x + c)^2 + 1)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (31) = 62\).

Time = 0.34 (sec) , antiderivative size = 141, normalized size of antiderivative = 4.27 \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=-\frac {{\left (\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) \mathrm {sgn}\left (-\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) \mathrm {sgn}\left (-\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) \mathrm {sgn}\left (-\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )\right )} \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}{d} \]

[In]

integrate((a-a*sec(d*x+c)^2)^(1/2),x, algorithm="giac")

[Out]

-(log(tan(1/2*d*x + 1/2*c)^2 + 1)*sgn(-tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c)) - log(abs(tan(1/2*d*x +
1/2*c) + 1))*sgn(-tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c)) - log(abs(tan(1/2*d*x + 1/2*c) - 1))*sgn(-tan
(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c)))*sqrt(-a)*sgn(cos(d*x + c))/d

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a-a \sec ^2(c+d x)} \, dx=\int \sqrt {a-\frac {a}{{\cos \left (c+d\,x\right )}^2}} \,d x \]

[In]

int((a - a/cos(c + d*x)^2)^(1/2),x)

[Out]

int((a - a/cos(c + d*x)^2)^(1/2), x)